package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.WholesalerMapper;
import com.ruoyi.system.domain.Wholesaler;
import com.ruoyi.system.service.IWholesalerService;

/**
 * 批发商管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-27
 */
@Service
public class WholesalerServiceImpl implements IWholesalerService 
{
    @Autowired
    private WholesalerMapper wholesalerMapper;

    /**
     * 查询批发商管理
     * 
     * @param wholesalerId 批发商管理主键
     * @return 批发商管理
     */
    @Override
    public Wholesaler selectWholesalerByWholesalerId(Long wholesalerId)
    {
        return wholesalerMapper.selectWholesalerByWholesalerId(wholesalerId);
    }

    /**
     * 查询批发商管理列表
     * 
     * @param wholesaler 批发商管理
     * @return 批发商管理
     */
    @Override
    public List<Wholesaler> selectWholesalerList(Wholesaler wholesaler)
    {
        return wholesalerMapper.selectWholesalerList(wholesaler);
    }

    /**
     * 新增批发商管理
     * 
     * @param wholesaler 批发商管理
     * @return 结果
     */
    @Override
    public int insertWholesaler(Wholesaler wholesaler)
    {
        wholesaler.setCreateTime(DateUtils.getNowDate());
        return wholesalerMapper.insertWholesaler(wholesaler);
    }

    /**
     * 修改批发商管理
     * 
     * @param wholesaler 批发商管理
     * @return 结果
     */
    @Override
    public int updateWholesaler(Wholesaler wholesaler)
    {
        wholesaler.setUpdateTime(DateUtils.getNowDate());
        return wholesalerMapper.updateWholesaler(wholesaler);
    }

    /**
     * 批量删除批发商管理
     * 
     * @param wholesalerIds 需要删除的批发商管理主键
     * @return 结果
     */
    @Override
    public int deleteWholesalerByWholesalerIds(Long[] wholesalerIds)
    {
        return wholesalerMapper.deleteWholesalerByWholesalerIds(wholesalerIds);
    }

    /**
     * 删除批发商管理信息
     * 
     * @param wholesalerId 批发商管理主键
     * @return 结果
     */
    @Override
    public int deleteWholesalerByWholesalerId(Long wholesalerId)
    {
        return wholesalerMapper.deleteWholesalerByWholesalerId(wholesalerId);
    }
}
